<?php
	class dbconnect{
		function connect()
			{
			  $con=mysql_connect("localhost","root",""); // select from 'test' database
				if (!$con)
				 {
				   die('Could not connect: ' . mysql_error());
				 }
				 
			   $db_selected = mysql_select_db("test", $con); // your phpMySQL user name
			    if(!$db_selected)
			    {
			       die('Could not connect: '.mysql_error());
			    }
			}
	}
?>